//
//  ListCollectionViewCell.m
//  项目A --半糖
//
//  Created by romana on 16/5/20.
//  Copyright © 2016年 romana. All rights reserved.
//

#import "ListCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation ListCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        [self doIt];
    }
    return self;


}

-(void)doIt{

    self.myImageView = [[UIImageView alloc] init];
    self.myImageView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.myImageView];
    
    self.biglabel = [[BaseLabel alloc] init];
    self.biglabel.backgroundColor = [UIColor clearColor];
    self.biglabel.font = [UIFont systemFontOfSize:14];
    self.biglabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.biglabel];
    
    self.smallLabel = [[BaseLabel alloc] init];
    self.smallLabel.backgroundColor = [UIColor clearColor];
    self.smallLabel.font = [UIFont systemFontOfSize:14];

    self.smallLabel.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.smallLabel];
    
    


}


-(void)layoutSubviews
{

    self.myImageView.frame = CGRectMake(30, 10, 60, 60);
    self.biglabel.frame = CGRectMake(0, 80, self.frame.size.width, 20);
    self.smallLabel.frame = CGRectMake(0, 100, self.frame.size.width, 20);

}


-(void)setListModel:(ListVCModel *)listModel{
    _listModel = listModel;
    
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:_listModel.icon]];

    self.biglabel.text = _listModel.name;
    self.smallLabel.text = _listModel.en_name;


}

@end
